package cc.magicjson.summary.errors.clz.not.found;

import java.util.HashMap;
import java.util.Map;

/**
 * {@link}
 *
 * @author <a href="mailto:it_magicjson@163.com">MagicJson</a>
 * @since 1.0.0
 */
public class LogManager {
    private static final Map<String, Logger> loggers = new HashMap<>();

    static {
        try {
            loggers.put("file", new FileLogger());
            loggers.put("database", new DatabaseLogger());
        } catch (Throwable t) {
            System.err.println("Error initializing loggers: " + t.getMessage());
            // 不重新抛出异常，让初始化继续
        }
    }

    public static Logger getLogger(String type) {
        return loggers.get(type);
    }
}
